home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Your Choice 3
/
Your Choice Software Collection 3.iso
/
docs
/
alias
/
long.al
next >
Wrap
Text File
|
1994-09-08
|
36KB
|
1,181 lines
#: 288513 S10/JP Software
! 26-Jul-94 21:14:31
Sb: #My favorite aliases
Fm: Sean Fosmire 76207,1120
To: All
These are my favorite aliases.
I would like to propose that this thread continue with contributions from
anyone who is interested. Perhaps someone could eventually collect the
messages and the aliases listed into one file for upload.
Some of my most useful aliases:
ca copy %1 %2 %3 %4 %5 %6 %7 %8 %9 a:\
: allows for entry of several filespecs for quick copy to A
sc select /od copy (%2*.*) %1
: organizes list of files then allows selection for copying
: 1st RP is the destination directory
sca select /o-d copy (%1*.*) a:\
: combines the best of the two above
: presents the current files, in reverse chronological order
: to permit selection for copying to A
: this way, the most recently added or changed files are on top
: I also have "sm" and "sma" which do the same thing for the move command
:
:-------------------------------------------------------------
: NOTE on replaceable parameters in aliases
: I frequently use the last RP in an alias as the first character
: in a wildcard
: see examples above and one below
: this allows for quick narrowing by filename by entering one or more letters
: e.g., with "d" below, enter "d ca" to list all files beginning with "ca"
:-------------------------------------------------------------
:
d dir/jp %1*.*
: the "jp" is my preference -- separate extensions, stop display by page
:
fre free c: d: e: f: g: j: n: > c:\freedoc ^ type c:\freedoc
: uses the "free" command to display free space on all current drives
I would invite other submissions.
Sean
There are 2 Replies.
#: 288580 S10/JP Software
) 27-Jul-94 13:19:43
Sb: #288513-My favorite aliases
Fm: Michael Geary 76146,42
To: Sean Fosmire 76207,1120
Sean, good idea on the "favorite alias" thread. Here are some of my
favorites to go along with yours...
First a few shortcuts to help manage aliases themselves:
: Make it easier to type the ALIAS command
al*ias *alias
: Edit Aliases
ea edit c:\txt\alias.lst
: Load Aliases
la ua * ^ alias /r c:\txt\alias.lst && echo Aliases loaded
: Clear Aliases
ua unalias
Then, the alias I use more often than any other:
: List the output of a command
l*cmd (%&) | list /s
This just runs any command and pipes its output to the LIST command. Very
simple, but extremely useful. L MEM /C is a typical use, or even L DIR.
When I saw your FRE alias, I realized there was one thing missing from LCMD:
it threw away the command output after piping it into LIST. I changed it to
save the file like your alias does, so now it's:
l*cmd (%&) >C:\TEMP\LCMD%_shell.LST ^ list C:\TEMP\LCMD%_shell.LST
In case I run LCMD in more than one DOS session under Windows, the %_shell
gives a unique file name to each of the "pipe" files. You could use %@unique
for this, but I wanted to be able to pick my own file name.
My FRE alias is identical to yours except it doesn't have the redirection
(and the number of drive letters). With the LCMD alias, you could cut FRE
down to:
fre free c: d: e: f: g: j: n:
and type L FRE at the C> prompt. (Or, of course, include the L at the
beginning of the FRE alias itself if you always run it that way.)
One last one for now is many people's favorite:
: Run a program in a specified directory: IN <path> <program>
in pushd %1 ^ %2& ^ popd
This replaces all the batch files that wrap PUSHD and POPD around some
program that likes to be run from its own directory.
My last one for now is a variation on this theme. I normally run my DOS
sessions in 50 line mode. A fair number of DOS programs have to run in 25
line mode. Most of those are smart enough to at least switch to thame mode
first, but some are not. They leave my screen in 50 line mode and run in the
top half of the screen, leaving the bottom half with whatever was on it.
Anyone who uses 50 line mode has run into this and may have batch files that
call MODE 80,25 before running such programs and MODE 80,50 after. The easy
way is:
in25 mode 80,25 ^ %& ^ mode 80,50
(Actually, I use my own 25 and 50 programs to switch screen height--they're
basically the same as MODE 80,XX but they also set the screen colors I like.
The concept of the alias is the same regardless.)
IN25 and IN combine well. To run V Communications' System Commander, I use:
scin in25 in c:\sc *scin
This is equivalent to the batch file:
mode 80,25
pushd c:\sc
scin
popd
mode 80,50
One last tip. Try changing your CA alias to this:
ca copy %& a:\
The %& is the same as your %1 %2 . . . %9 but handier, and it removes the
limit of nine parameters.
That's all for now...
-Mike
p.s. I don't get credit for most of these aliases, I'm just passing them
along. Various 4DOS users here in the forum and elsewhere have come up with
these tricks.
#: 288861 S10/JP Software
! 29-Jul-94 23:05:27
Sb: #288580-#My favorite aliases
Fm: Sean Fosmire 76207,1120
To: Michael Geary 76146,42 (X)
Mike -
Thanks for the tips. I like the technique of piping output directly to the
List command. Can be very handy for some applications. The benefit of
directing output to a file is that it remains available for later reference,
until the next time the alias is run.
And thanks for your advice on %& as an RP. I was not aware of that one.
Your comment on attribution of aliases is a good one. I suspect that the CA
alias I posted came from someone else. Certainly, about half of the aliases in
my ALIASES file came from someone else's imagination, so if any of us post one
which someone else has originated, I hope we all consider it in the spirit of a
general advancement of alias technique.
One alias I neglected to add to my previous posting, and one which I use quite
often, is deceptively simple:
ix dir/djs > index
: This produces an ASCII file listing all files in the current directory
: and all subdirectories. If run from C:\, it will list all files in all
: directories, with summary information.
I find myself using the INDEX quite often, using the List command or my Select
List alias, which is:
sl select list (%1*.*)
I'm finding a lot of good ideas in these replies.
Sean
There are 3 Replies.
#: 288900 S10/JP Software
! 30-Jul-94 15:31:17
Sb: #288861-#My favorite aliases
Fm: Howard Goldstein 71435,1203
To: Sean Fosmire 76207,1120
Here's my favorite alias. It's a bit more complex than some of the others
that have been contributed here but I hope someone reading this will find it
useful.
This is an alias for the TIME command. If entered with no operands, the date
and time are displayed as with the normal TIME command but the user is not
prompted for a new time. If a parameter is given, the time is set.
Note that this should all be entered on one line and that the caret (^) is
used as the command separator:
time iff %#==0 then^keystack enter^*time|echo %@line[con,0]^
else^*time %&^endiff
There is 1 Reply.
#: 288933 S10/JP Software
! 31-Jul-94 01:07:46
Sb: #288900-#My favorite aliases
Fm: Mike Bessy [Forum Admin] 75300,1215
To: Howard Goldstein 71435,1203 (X)
Howard,
May I suggest a variation that doe _not_ require that KSTACK be loaded and can
also be used under OS/2 or NT (with suitable ParameterChar and CommandSep, of
course):
time=iff "%&"=="" then^echo The time is %_time^else^echo %&|*time^endiff
07-30-94 23:30 CDT
There is 1 Reply.
#: 288946 S10/JP Software
! 31-Jul-94 11:52:33
Sb: #288933-#My favorite aliases
Fm: Howard Goldstein 71435,1203
To: Mike Bessy [Forum Admin] 75300,1215 (X)
Thanks, Mike.
A question though: In the "else" part of your alias you have
echo %&|*time
Why not the much simpler
*time %&
Howard
There is 1 Reply.
#: 288955 S10/JP Software
! 31-Jul-94 15:38:50
Sb: #288946-My favorite aliases
Fm: Mike Bessy [Forum Admin] 75300,1215
To: Howard Goldstein 71435,1203 (X)
Howard,
Indeed, "*time %&" should be more than sufficient.
07-31-94 14:20 CDT
#: 291016 S10/JP Software
! 23-Aug-94 07:01:25
Sb: #288955-#My favorite aliases
Fm: Don E. Groves, Jr. 71310,3702
To: Mike Bessy [Forum Admin] 75300,1215 (X)
This seems the perfect place to add my DATER and DATER12 aliases to the list:
DATER=(dater_date %+ ECHO %_time)
DATER12=(dater_date %+ dater_time ^echo.)
DATER_DATE=
ECHOS %_Dow %@substr[JanFebMarAprMayJunJulAugSepOctNovDec,
%@eval[(%@substr[%_date,0,2]-1)*3],3] %@eval[%@substr[%_date,3,2]],
19%@substr[%_date,6,2]
DATER_TIME=
ECHOS %@substr[12 1 2 3 4 5 6 7 8 91011,
%@eval[%@substr[%_time,0,2] %% 12*2],2]
%@substr[%_time,2,6]
%@substr[AP,%@int[%@eval[%@time[%_time]/3600/12]],1]M
(note DATER_DATE and DATER_TIME each go on one long line a piece. :-)
They produce the output in the format of:
DATER
Tue Aug 23, 1994 00:23:16
and
DATER12
Tue Aug 23, 1994 12:24:03 AM
And yes the are all pipeable to a file or whereever.
DG.. {back again <G>}
There is 1 Reply.
#: 291221 S10/JP Software
! 24-Aug-94 19:05:58
Sb: #291016-My favorite aliases
Fm: Howard Goldstein 71435,1203
To: Don E. Groves, Jr. 71310,3702
Don,
Interesting aliases! I'd like to point out though that DATER_DATE and
DATER_TIME could be greatly simplified by using the _MONTH, _DAY, etc. system
variables available in 4DOS 5 rather than extracting the various fields from
_DATE and _TIME. For example:
DATER_DATE=
ECHOS %_Dow %@substr[JanFebMarAprMayJunJulAugSepOctNovDec,
%@eval[(%_month-1)*3],3] %_day, %_year
Howard
#: 289169 S10/JP Software
! 02-Aug-94 12:42:55
Sb: #288861-My favorite aliases
Fm: Charlie Weesner 71310,347
To: Sean Fosmire 76207,1120
Sean,
My "favorite" three aliases require using NCD (Norton's Change Directory) or
LCD (LED's Change Directory). These programs provide direct navigation from
any level of the directory tree to any other level (including completion of
partial directory names or mis-spellings).
cd=lcd
md=lcd md
rd=lcd rd
If you want to use the original command, rather than the alias, you either
"chdir" or "*cd" where the "*" disables any alias replacement of the
command.
Charlie
#: 289192 S10/JP Software
! 02-Aug-94 14:53:39
Sb: #288861-My favorite aliases
Fm: Michael Geary 76146,42
To: Sean Fosmire 76207,1120
Yes, I wouldn't worry too much about attributing aliases to the right person.
A lot of them have been floating around so long that no one remembers who
first thought of them. <g>
-MG
#: 289100 S10/JP Software
! 02-Aug-94 00:00:58
Sb: #288580-#My favorite aliases
Fm: Niels Schaumann 73763,352
To: Michael Geary 76146,42 (X)
Michael,
> : List the output of a command l*cmd (%&) | list /s
I like this one! Very nice ....
Here's one (a pair, actually) of my favorites:
:walks back up the directory tree from current location, # levels = # dots
.*........ pushd%0
:nothing fancy, just what it says
popd
I've gotten used to these, been using them for a couple of years. I don't
remember who came up with them .... I do remember someone pointing out that
the "multiple dots" weren't supposed to work, but hey ..... they sure do!
--Niels
There is 1 Reply.
#: 289193 S10/JP Software
! 02-Aug-94 14:53:42
Sb: #289100-#My favorite aliases
Fm: Michael Geary 76146,42
To: Niels Schaumann 73763,352 (X)
Neat! I didn't know you could use just "." (or "....", etc.) as a command
name. Since you can also use "..\" (with any number of dots) as a shortcut
for CD, this lets you do either the CD or the PUSHD very easily.
There is 1 Reply.
#: 288623 S10/JP Software
! 27-Jul-94 20:11:56
Sb: #288513-My favorite aliases
Fm: Gary M. Berg 70106,1624
To: Sean Fosmire 76207,1120
Let's see, what do I have sitting around in my 4DOS.ALI file:
; Clear the screen
clear cls white on blue
; Run a command and pipe stdout into LIST
so %& | list/s
; Use a "string" utility to get likely "text" in a file, send it to
; stdout and view it with LIST
inside so string %&
; Reload standard aliases
new_4d*os unalias * ^ alias /r c:\cmd\4dos.ali
; Control/T runs MAPMEM
@@ctrl-T mapmem
; Alt-F4 types EXIT - similar to closing a winapp
@@Alt-F4 exit
;
; Directory management utilities. Allow changing to a subdir to run
; a program and then return - will not have changed current directory
; on any drives.
popdir_2
popdir_3
push_xd pushd d: ^ pushd
push_xdf pushd d: ^ pushd e: ^ pushd
push_xe pushd e: ^ pushd
; Example of using push and pop routines
alpha*4 push_xde^cd \alpha4^*a4 %&^popdir_3
;
; ACD is a utility a bit like NCD; use it so an invalid command tries
; to change to the command line as a sub-directory.
UNKNOWN_CMD acd %1
#: 288751 S10/JP Software
! 28-Jul-94 21:49:15
Sb: #288623-#My favorite aliases
Fm: Gary M. Berg 70106,1624
To: Gary M. Berg 70106,1624 (X)
<red faced>
popdir_2 popd^popd
popdir_3 popd^popd^popd
Probably obvious, but...
There is 1 Reply.
#: 288759 S10/JP Software
! 29-Jul-94 00:38:53
Sb: #288751-#My favorite aliases
Fm: Kenneth Albanowski 70705,126
To: Gary M. Berg 70106,1624 (X)
Gary,
>> <red faced> <<
Don't worry, those are perfectly decent aliases. FORTH has had "dup2" and
"drop2" for quite some time, and they are just "dup dup" and "drop drop".
- Ken
There are 2 Replies.
#: 288795 S10/JP Software
! 29-Jul-94 11:15:35
Sb: #288759-#My favorite aliases
Fm: Bryan S. (TurboPower) 71175,3534
To: Kenneth Albanowski 70705,126 (X)
>> "dup dup" and "drop drop" <<
As opposed to, say, "plop plop" and "fizz fizz"? <g>
--Bryan
There is 1 Reply.
#: 288828 S10/JP Software
! 29-Jul-94 17:12:03
Sb: #288795-My favorite aliases
Fm: Kenneth Albanowski 70705,126
To: Bryan S. (TurboPower) 71175,3534 (X)
Bryan,
And of course the ever popular "bork3". (Coooome heeeere leettle chicky!)
- Ken
#: 288849 S10/JP Software
! 29-Jul-94 21:16:53
Sb: #288759-My favorite aliases
Fm: Gary M. Berg 70106,1624
To: Kenneth Albanowski 70705,126
Ken,
Oh, you misunderstood, I left the definition of those two aliases out of the
message I was commenting to. The red face was from not proofing my message
before I sent it. The popdir_2 and such go with somewhat more useful macros
which save the current directory on this and 1 or 2 other drives.
#: 288923 S10/JP Software
! 30-Jul-94 22:32:19
Sb: #288849-#My favorite aliases
Fm: Kenneth Albanowski 70705,126
To: Gary M. Berg 70106,1624 (X)
Gary,
Indeed I did misunderstand, my fault completly. (Besides, if I'm going to
comment on "simple alises", I should add it my "lsit=list" <g>)
- Ken
There is 1 Reply.
#: 289006 S10/JP Software
! 01-Aug-94 09:47:35
Sb: #288923-#My favorite aliases
Fm: Bryan S. (TurboPower) 71175,3534
To: Kenneth Albanowski 70705,126 (X)
>> "lsit=list" <<
You do that too? <g> I have a "compile" alias which is also aliased as
"xinoukw"!!! <g>
--Bryan
There is 1 Reply.
#: 288840 S10/JP Software
! 29-Jul-94 17:56:57
Sb: #288623-#My favorite aliases
Fm: Dave Hill 71020,2604
To: Gary M. Berg 70106,1624 (X)
I had a "MO" alias similar to your "so", and in order to handle some unusual
command lines and make it more universal, I changed it to:
MO=(%&) | LIST /S
This should work everywhere the other one does, and handles a multi-command
line.
Regards,
Dave
There is 1 Reply.
#: 288850 S10/JP Software
! 29-Jul-94 21:17:01
Sb: #288840-My favorite aliases
Fm: Gary M. Berg 70106,1624
To: Dave Hill 71020,2604
Dave,
I guess I've never tried to pass a multi-command line to my SO alias. "SO"
would work if all you were doing was piping from program to program; I never
thought about doing several commands and dumping them all into LIST at the
same time.
Wait a minute, I just tried you "SO" alias with:
SO (dir^dir)
And I only got the output from the first DIR command; the second dir command
came out after I exited LIST.
These are the aliases I was working with:
so (%&) | list/s
soe (%&)>piped.xxx^attrib +r piped.xxx/q^me piped.xxx^del piped.xxx/q/z
Shouldn't that have worked?
#: 288901 S10/JP Software
! 30-Jul-94 15:31:20
Sb: #288850-#My favorite aliases
Fm: Howard Goldstein 71435,1203
To: Gary M. Berg 70106,1624 (X)
Gary,
The SO alias does work for multiple commands. The reason it didn't work for
you was that you weren't using it right. Try `DIR^DIR` instead of (DIR^DIR).
Howard
There is 1 Reply.
#: 288908 S10/JP Software
! 30-Jul-94 18:01:35
Sb: #288901-#My favorite aliases
Fm: Gary M. Berg 70106,1624
To: Howard Goldstein 71435,1203 (X)
>> Try `DIR^DIR` instead of (DIR^DIR).
I tried it both ways. In both cases, the second "DIR" comes out after I have
viewed the results for the first one with LIST.COM. My alias is set up as:
so (%&) | list/s
So when I type: so dir^dir
I get the second directory after the LIST viewer. Have you _confirmed_ that
it works with 4DOS 5.0F?
There are 2 Replies.
#: 288915 S10/JP Software
! 30-Jul-94 21:55:44
Sb: #288908-#My favorite aliases
Fm: Jim Kyle (CLMFOR) 76703,762
To: Gary M. Berg 70106,1624 (X)
Gary,
Typing so dir^dir is exactly the same as typing so dir on one line and then
dir on the next line. However if you type it, at the prompt, as so `dir^dir`
then you will in fact get two sequential directories passed into list. I just
confirmed this using version 5.0F.
Your parentheses inside the alias can't do anything until the parser passes
the command line in, and unless you shield the compound command from the
parser with the reverse single quotes, the damage will already have been done
by that time!
In fact, I believe (though Mike, Rex, or Tom may correct me on this) that
your parentheses inside the alias do nothing at all. While using them is a
good idea in defining C macros, to prevent precedence problems if you pass in
an expression, the situation is drastically different in 4DOS. The parser has
already been over the command line and done its thing, so any precedence
problem that might exist (such as the command separator breaking off the back
half of what you meant to pass to the alias) has already done its thing before
ever reaching the parens...
When dealing with the 4DOS parser, the _only_ surefire protection method
I've ever found is to bracket things inside of reversed quotes. In some cases,
the square brackets work, but in others they don't. The reversed quotes always
shield whatever they contain from the parser's view.
There is 1 Reply.
#: 288947 S10/JP Software
! 31-Jul-94 11:52:37
Sb: #288915-My favorite aliases
Fm: Howard Goldstein 71435,1203
To: Jim Kyle (CLMFOR) 76703,762 (X)
Jim,
I believe that the parentheses within the SO alias are necessary. The
parentheses signify a "command group" to which we want the pipe to apply.
Without them, the pipe would only apply to the last command in a multiple
command line passed to the alias.
Howard
#: 288917 S10/JP Software
! 30-Jul-94 22:06:43
Sb: #288908-#My favorite aliases
Fm: Howard Goldstein 71435,1203
To: Gary M. Berg 70106,1624 (X)
Gary,
My SO alias is set up exactly the same as yours and SO `DIR^DIR` definitely
works for me in 4DOS 5.0f. Perhaps I wasn't clear enough in my last message.
You need to put back quotes around the DIR^DIR so that that entire string will
be treated as a single argument to SO. Without the back quotes, only the
first DIR is being passed to SO.
Howard
There are 2 Replies.
#: 288938 S10/JP Software
! 31-Jul-94 10:02:16
Sb: #288917-My favorite aliases
Fm: Gary M. Berg 70106,1624
To: Howard Goldstein 71435,1203 (X)
Mea Culpa! I didn't notice the back-quotes! Or thought they were a type. In
fact, this morning as I was laying in bed I started think what Jim Kyle said;
that I have to do something to make the command separator on the original
command line not be a command separator or I'd be doing "SO DIR" and "DIR".
So now, "SO" works fine. I'd just never run into this problem of trying to
pass multiple commands to an alias.
And checking shows me that the "()"'s are required, or else the first command
is not sent into LIST.
#: 288896 S10/JP Software
! 30-Jul-94 13:59:51
Sb: #288513-My favorite aliases
Fm: Eric Veldhuyzen 100010,3051
To: Sean Fosmire 76207,1120
Sean,
You want some nice aliases? How about my dir alias under 4OS2:
DIR=iff "%1" eq "" then
^set pad=.
^else set pad=%1
^endiff
^iff exist %pad\descript.ion then
^*dir /A/Z/P/O:gE/J %&
^unset pad
^quit
^else
^*dir /T/A/P/O:gE/J %&
^unset pad
^quit
^endiff
This of course all on one line, but I cut it for readability.
Eric Veldhuyzen in Oegstgeest, NL 30-Jul-94 at 19:45:13 MET
#: 289097 S10/JP Software
! 01-Aug-94 23:20:53
Sb: #288513-#My favorite aliases
Fm: Ray Tackett 76416,276
To: Sean Fosmire 76207,1120
Sean,
For sheer, compact elegance and usefulness, my favorite is one of Tom
Rawson's:
IN=pushd %1 ^ %2& ^ popd
Example: in games mahjongg -b37
With the CDPATH environment variable set to C:\;D:\;etc., I don't need a
ridiculous PATH to get to the hundreds of programs on my system. It's also
the basis for many of my other aliases and batch files. For example:
TRACON=in tracon2 *tracon
allows me to run Wesson International's air traffic control simulation with a
single command word no matter what the current directory and despite the fact
that K:\TRACON2 is not on PATH and despite the fact that I can't remember
what's on which logical drive.
Ray
There is 1 Reply.
#: 289741 S10/JP Software
! 09-Aug-94 02:38:00
Sb: #289097-#My favorite aliases
Fm: Anthony Williams 76655,1552
To: Ray Tackett 76416,276 (X)
Ray,
Do you have a good way to deal with directories that different drives,
depending on whether a CDRom or Bernoulli or Ramdisk is installed? I am faced
with a situation where sometimes its E:\OZCIS, and sometimes F:\OZCIS. What's
the slick way to handle this?
I have never paid attention to the CDPATH envar in 4Dos because I am happy
with LCD. Your example however shows how it can be used for commands other
than CD. But I wonder, if one puts most complicated commands into aliases,
why not just enter the path there and be done with it? Given aliases, does
that method add anything?
I always look forward to your messages here for I have learned a lot from them
over time.
Tony
There is 1 Reply.
#: 289750 S10/JP Software
! 09-Aug-94 07:10:43
Sb: #289741-#My favorite aliases
Fm: Ray Tackett 76416,276
To: Anthony Williams 76655,1552 (X)
Tony,
I don't have a good way to deal with the same directory on different drives. I
usually try to keep names unique. For example, my "day job" involves doing
tech support for a COBOL compiler and a 370 Assembler emulator. Each product
has several versions which must be supported, so I have directories like
COB3060, COB3159, COB3220, etc.
>>> Why not just enter the path ...
There's a long evolutionary history at this end. It started with an XT clone
and a 10 meg MFM drive which was all C:. As CPUs and disks came, went, and
grew, I kept adding drive letters. The worst time was the combination of DOS
3.3 and 250 meg of disk. Since no partition could be bigger than 32M, I ended
up with a lot of drive letters.
Now I'm up to 1.5 gig with about 160 root-level directories. Each logical
drive (except C, which is just big enough to hold DOS) is >32M, but many a
program hard-codes itself for a certain drive and directory at installation
time. As free space goes away and new software comes in, I move directory
trees from one drive to another. I don't want to remember what's where and I
_certainly_ don't want to find and fix a bunch of hard-coded batch files and
aliases every time I change something. Try moving a Windows product such as
W4W or Excel; find and fix all the .INI files, etc. As Tropicana once put it,
"It's more excitement than decent people need." <g>
Yeah, I'd probably spend a weekend merging logical drives, backing up,
repartitioning, etc., but there are other payoffs. One of my most-used
packages has the habit of losing disk clusters. That package resides in a
special 18 meg logical drive (N:) where its bad habit won't affect anything
else. Such things provide convenient rationales for procrastination <g>.
It really comes down to personal style and its evolution over time. "Your
actual mileage may vary."
Ray
There is 1 Reply.
#: 289764 S10/JP Software
! 09-Aug-94 11:16:25
Sb: #289750-#My favorite aliases
Fm: Anthony Williams 76655,1552
To: Ray Tackett 76416,276 (X)
Ray,
>> I don't have a good way to deal with the same directory on different
>> drives.
I didn't explain very well. I avoid identically named directories (I know
better). The problem is that depending on my boot configuration, a program
may be, for example, in E:\QPRO today and F:\QPRO tomorrow. This can be
caused by the presence or absence of a removable drive (Bernoulli) or a CDRom
drive.
The question is somewhat moot, because at present I don't have this problem,
but I recently did while trouble-shooting, and had cause to wonder whether
there was a way around. I thought I dimly remembered seeing something from
you or Mike Bessy a couple of years ago showing how all drive letters could be
replaced by envirs. Given that I thought one could somehow detect the
presence of one of the problem causer drives and change the envir accordingly.
This came up when trying to make a Bernoulli IDE drive work on both Dos and
OS/2 boots with Boot Manager. Apparently it can't be done, short of very
extreme measures, but in trying I had the problem described.
I too have lots of partitions and would like to find a better system to keep
track of them.
>> As free space goes away and new software comes in, I move directory
>> trees from one drive to another.
What is the *safest* way to do this?
Tony
There is 1 Reply.
#: 289811 S10/JP Software
! 09-Aug-94 18:42:27
Sb: #289764-#My favorite aliases
Fm: Ray Tackett 76416,276
To: Anthony Williams 76655,1552 (X)
Tony,
>>> E:\QPRO today and F:\QPRO tomorrow.
That's exactly what having CDPATH=C:\;D:\;E:\... is meant to handle. I set it
dynamically according to what drives are available at boot (Bernoulli, CD,
ramdisk, etc.) via the following subroutine in my autoexec:
rem SET CDPATH
:cdpath
rem The object of the game is to end up with CDPATH set to:
rem C:\;D:\<etc. to last drive letter>
set work=CDEFGHIJKLMNOPQRSTUVWXYZ
set count=1
set cdpath=C:\
:cdloop
set d=%@substr[%work,%count,1]:
rem if beyond last OR beyond end of %work string
if %d gt %_lastdisk: .or. "%d" == ":" goto cdexit
rem skip CD-ROM in MS-DOS or OS/2 DOS
if %@removable[%d] eq 0 .AND. %@remote[%d] eq 0 set cdpath=%[cdpath];%d\
set count=%@eval[%count+1]
goto cdloop
:cdexit
unset work count d
return
Once this is set, the alias IN will work or you can just PUSHD QPRO and that's
where you'll go.
The safest way to move directory trees:
1. Backups
2. Backups
3. More Backups
If you follow that rule, any of COPY, MOVE, or XCOPY with appropriate command
line switches works fine.
Ray
There are 2 Replies.
#: 290000 S10/JP Software
! 11-Aug-94 13:04:01
Sb: #289811-#My favorite aliases
Fm: Anthony Williams 76655,1552
To: Ray Tackett 76416,276 (X)
Ray,
I learned something from your system for setting cdpath and using your alias
IN, but I'm afraid it won't work for me. Unless I'm mistaken, you must have
your executables only in directories just below the root. This would result
in more first-level directories than I like. I prefer to have first level
dirs for categories, eg. D:\COSMOS, which contains all my astronomy programs
in separate dirs, eg. SKY\, SUN\, PLAN\, ECL\, etc.
Perhaps you have a way of dealing with that, specifically when a program might
be in d:\cosmos\sky or e:\cosmos\sky depending....
I guess I've been spoiled by LCD which allows partial names (cd cos). I'd
like that in running programs.
Tony
There is 1 Reply.
#: 290028 S10/JP Software
! 11-Aug-94 18:55:09
Sb: #290000-#My favorite aliases
Fm: Ray Tackett 76416,276
To: Anthony Williams 76655,1552 (X)
Tony,
Just a quick, off-the-top shot at it:
in cosmos set cdpath=%[cdpath];%_cwds
You could do it a bunch of times like this (packaged up as a subroutine):
:subrout
set dirstr=COSMOS TOPPERS GEORGES MARIANS KIRBYS NEILS GHOSTS
set count=0
:loop
rem Get the next directory name to find
set work=%@word[%count,%dirstr]
rem Test for end of list
if "%work" eq "" goto loopexit
rem Do the deed
in %work set cdpath=%[cdpath];%_cwds
rem Keep on doing it to end of list
set count=%@eval[%count + 1]
goto loop
:loopexit
unset count dirstr
return
Again, the above has simply been typed into this message UNTESTED. I do
something similar in my autoexec.bat to select TSRs for loading.
Ray
P.S. Ten extra points to the first person who can tell me to what those
fake directory names refer <g>.
There are 2 Replies.
#: 290078 S10/JP Software
! 12-Aug-94 14:57:18
Sb: #289811-#My favorite aliases
Fm: Anthony Williams 76655,1552
To: Ray Tackett 76416,276 (X)
Ray,
I am trying to modify your system for setting CDPATH for my needs and I have
come on another stumbling block. In your loop expression I added tests for
@removable[] and @cdrom[] to set variables for my Bernoulli and CDRom drives.
So far, so good. Then I wanted to identify my Ramdisk, if installed. Since
there seems no function to identify one, I used a @label[] expression in the
loop. This is OK, provided there are disks in the Bernoulli and CDRom.
Otherwise I get the damned "Drive Not Ready" warning.
How can I identify a Ramdisk even when the CDRom drive is empty?
Tony
There is 1 Reply.
#: 290107 S10/JP Software
! 13-Aug-94 00:11:07
Sb: #290078-#My favorite aliases
Fm: Ray Tackett 76416,276
To: Anthony Williams 76655,1552 (X)
Tony,
The way I identify mine is to work backward through the alphabet from
%_lastdisk until I hit the first ready, non-removable, non-remote drive
letter. I think you can figure that one out from one of my previous.
Ray
There are 2 Replies.
#: 290151 S10/JP Software
! 14-Aug-94 05:10:45
Sb: #290107-#My favorite aliases
Fm: Anthony Williams 76655,1552
To: Ray Tackett 76416,276 (X)
Ray,
I did succeed in getting what I wanted, but using your original scheme of
going forward through the drive letters. I just wrote a series of IFF tests
for %@cdrom, %@removable, %@ready, and @label. Works like a charm! Thanks
very much for the hints. Between you and Mike here and the folks at Semware,
who help me with TSE macros, I am not lacking for stimulation and challenge.
Tony
There is 1 Reply.
#: 289743 S10/JP Software
! 09-Aug-94 03:21:35
Sb: #288513-#My favorite aliases
Fm: Anthony Williams 76655,1552
To: Sean Fosmire 76207,1120
Sean,
Here are some of my favorites. I do not claim authorship. Most came from
this wonderful forum.
4ED*DIT=select %1 describe (*.*)
@@Shift-F1=so *alias
ADDR*ESS=ks "f%&" 13 %+ list e:\mydoc\addr.bk
ALLF*REE=free c: %+ free d: %+ free e: %+ free f: %+ free g:
ALUP*DATE=pushd c:\4dos50 %+ COPY ALIAS.LST ALIAS.%@SUBSTR[%_TIME,4,1
]%@SUBSTR[%_TIME,6,2] /Q %+ alias > alias.lst %+ echo !ALIAS
LIST UPDATED! %+ renew %+ popd %+ beep
DIRARC=dir *.zip;*.arj;*.lzh
DIRBAT=dir *.btm;*.bat
DIRCMD=dir /k *.exe;*.com;*.btm;*.bat
DIREX=dir *.com;*.exe
MEMF=free %+ memory
NOW=echo It is now %_time on %_dow %_date
RENEW=unalias * %+ alias /r c:\4dos50\alias.lst %+ echo ALIAS LIST REREAD!
RESETN=unset * %+ set /r c:\4dos50\var.lst %+ echo ENVIRONMENTAL VARIABLES
RESET!
SOT*se=%& > %tmp%!tsetmp!.!!! %+ e %tmp%!tsetmp!.!!! %+ del %tmp%!tsetmp!.!!!
TOCP=prompt $p$g %+ set comspec=c:\dos\command.com %+ c:\dos\command/e:2048
%+ c:\4dos50\4start %+ set comspec=c:\4dos50\4dos.com
Explanation
4ED -- select files for writing Descriptions
ADDR -- calls up my address book in Buerg's LIST and finds the name I have
requested, e.g. "ADDR Smith"
ALUP -- updates my master alias list, but only after making a backup
DIRARC, DIRBAT, DIRCMD, DIREX -- various selective Dir commands
SOT -- puts standard output into my editor via a temp file
TOCP -- when I want to see how hard a time the other 99% of PC users have
it!
Tony
There is 1 Reply.
#: 289778 S10/JP Software
! 09-Aug-94 12:48:49
Sb: #289743-My favorite aliases
Fm: Allen Cobb 74273,1307
To: Anthony Williams 76655,1552 (X)
Keeping the thread alive, here are some of the aliases I use most often:
; Make a directory and move files with same first name into it.
MDF=md %1^move %1.* %1^cd %1
; Remove file from B: and copy new version to B:.
BDELCOPY=del b:%1^copy %1 b:
; Quick access to doc, bat, & btm files.
DOC=c:\util\list.com c:\doc\%1.doc
BAT=c:\util\q.exe c:\bat\%1.bat
BTM=c:\util\q.exe c:\bat\%1.btm
; Quick setup for 4DOS aliases, etc. (This may be my favorite.)
S4=c:\util\q.exe c:\bat\set4dos.bat c:\4dos\4dos.ini^c:\bat\set4dos.bat
; Directory shortcuts.
CD=*pushd
PD=pushd
BD=popd
H=cd \^cdd c:\^cls
; Safety enhancements.
MOVE=*move /r
COPY=*copy /r
DELDIR=echo CAUTION! Removing %1 and all subdirs!^pause^del %1 /sxqy
; Standard calculator alias from docs.
CALC=*set x=%@eval[%&]^echo %x
; PKZIP shorthand.
UZP=select c:\util\pkunzip (*.*) d:\ %1
LZP=select c:\util\pkunzip (*.zip) -vn | list /s
AZP=select c:\util\pkzip %1 -a %2& [*.*]
; 50,000,000 directory commands.
D=*dir /kmpaou primary DIR command
DB=*dir b: /kpaou show drive B:
DA=*dir /4kmpvou /aa show everything
D2=*dir /p2ou /v two columns
DD=*dir /4kmpv wide, with sizes
DW=*dir /pouwkmv very wide
DF=*dir /pkmt/a-d/o:u just a file list
DC=*dir /kmpaou *.c c source files
DR=*dir /adwkm just directories, very wide
DZ=*dir /su just space info
DZIP=*dir /kmpaou *.zip just zips
DX=except (%%&) *dir /oufp
DDIR=*dir /ad just dirs, listed
DRI=dir yes, I do this too
DIR=*dir /ou default dir
DH=echo D DA DB DD DW DF DC DZ DX DR DDIR DRI DIR
Most are pretty obvious, but they're handy anyway! <g>
Malibu, 09-Aug-1994 @ 09:45:56 (NavCIS)